// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

	// Use the console to output diagnostic information (console.log) and errors (console.error)
	// This line of code will only be executed once when your extension is activated
	console.log('Congratulations, your extension "boby-vs-config" is now active!');

	// The command has been defined in the package.json file
	// Now provide the implementation of the command with registerCommand
	// The commandId parameter must match the command field in package.json
	let disposable = vscode.commands.registerCommand('boby-vs-config.helloWorld', () => {
		// The code you place here will be executed every time your command is executed

		// Display a message box to the user
		vscode.window.showInformationMessage('这是我的测试版本   !');
	});

	context.subscriptions.push(disposable);

	//打开面板并最大化面板
	let openPanelAndMax = vscode.commands.registerCommand('boby-vs-config.openPanelAndMax', () => {
		// The code you place here will be executed every time your command is executed
		vscode.commands.executeCommand("workbench.action.toggleMaximizedPanel").then((ret)=>{
			console.log("xxxxxxxx:", ret);
		});

		vscode.commands.executeCommand("workbench.action.focusPanel").then((ret)=>{
			console.log("dddddd:", ret);
		});
	});

	context.subscriptions.push(openPanelAndMax);

	//最大化编辑页面，并且关闭面板
	let closePanelOpenPreviousEditor = vscode.commands.registerCommand('boby-vs-config.closePanelOpenPreviousEditor', () => {
		// The code you place here will be executed every time your command is executed
		vscode.commands.executeCommand("workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup").then((ret)=>{
			console.log("xxxxxxxx:", ret);
		});

		vscode.commands.executeCommand("workbench.action.closePanel").then((ret)=>{
			console.log("dddddd:", ret);
		});


	});

	context.subscriptions.push(closePanelOpenPreviousEditor);
}

// this method is called when your extension is deactivated
export function deactivate() {}
